package cn.com.czpb.client.module.personal.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import cn.com.czpb.client.R;
import cn.com.czpb.client.model.usercenter.NotifyBean;

import java.util.List;

/**
 * Created by Administrator on 2017/8/29.
 */

public class NotifyAdapter extends BaseMultiItemQuickAdapter<NotifyBean,BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public NotifyAdapter(List<NotifyBean> data) {
        super(data);
        addItemType(0, R.layout.item_message);
    }

    @Override
    protected void convert(BaseViewHolder helper, NotifyBean item) {
            switch (helper.getItemViewType()){
                case 0:

                    helper.getView(R.id.reply_message).setVisibility(View.GONE);
                    helper.getView(R.id.iv_user_message).setVisibility(View.GONE);
                    helper.setText(R.id.tv_content_message,item.getContent());
                    helper.setText(R.id.time_message,item.getCreate_time());
                    helper.setText(R.id.tv_name_message,"系统通知");
                    break;
            }
    }
}
